package com.itheima.Wuziqi.entity;

import java.io.Serializable;

/**
 * 用户实体类
 */
public class User implements Serializable {
    private static final long serialVersionUID = 1L;
    
    private String username;
    private String password;
    private int winCount;  // 胜场数
    private int loseCount; // 负场数
    private int drawCount; // 平局数

    public User(String username, String password) {
        this.username = username;
        this.password = password;
        this.winCount = 0;
        this.loseCount = 0;
        this.drawCount = 0;
    }

    // getter和setter方法
    public String getUsername() {
        return username;
    }

    public String getPassword() {
        return password;
    }

    public int getWinCount() {
        return winCount;
    }

    public void setWinCount(int winCount) {
        this.winCount = winCount;
    }

    public int getLoseCount() {
        return loseCount;
    }

    public void setLoseCount(int loseCount) {
        this.loseCount = loseCount;
    }

    public int getDrawCount() {
        return drawCount;
    }

    public void setDrawCount(int drawCount) {
        this.drawCount = drawCount;
    }
    
    // 增加胜场
    public void incrementWin() {
        this.winCount++;
    }
    
    // 增加负场
    public void incrementLose() {
        this.loseCount++;
    }
    
    // 增加平局
    public void incrementDraw() {
        this.drawCount++;
    }
}
    